import request from '@/utils/request'
// import store from '@/store'
export const login = function(mobile, code) {
  return request({
    method: 'post',
    url: '/v1_0/authorizations',
    data: {
      mobile,
      code
    }
  })
}

/**
 *
 * @returns
 */
export const getUserInfo = function() {
  return request({
    method: 'GET',
    url: '/v1_0/user/profile'
    // headers: {
    //   Authorization: 'Bearer ' + store.state.user.token.token
    // }

  })
}
/**
 *
 * @param {Object} user 修改数据的对象
 * @returns
 */
export const upDateUserInfo = function(user) {
  return request({
    method: 'PATCH',
    url: '/v1_0/user/profile',
    data: user
  })
}
/**
 *
 * @param {} fd包含参数名和file的fromdata对象
 * @returns
 */
export const uploadPhoto = function(fd) {
  return request({
    method: 'PATCH',
    url: '/v1_0/user/photo',
    data: fd
  })
}
